;(function($) {

var funcInsertSource = function (obj, event, key) {
	obj.execCommand('inserthtml', '<pre class="prettyprint">insert source</pre>');
};
var funcInsertSourceWithNums = function (obj, event, key) {
	obj.execCommand('inserthtml', '<pre class="prettyprint linenums">insert source with line number</pre>');
};
$('textarea.redactor').each(function() {
	var oThis = $(this);
	oThis.redactor({
		lang :"ko",
		css :"../../css/editor.css", // now? ../usr/admin/js/redactor.js, and, ../usr/admin/js/css/ is default. so, ../../
		interval : 60,
		imageUpload : oThis.data('imageup'),
		fileUpload : oThis.data('fileup'),
		buttons : ['html', '|', 'formatting', '|', 'bold', 'italic', 'deleted', '|', 
			'outdent', 'indent', '|',
			'image', 'video', 'file', 'table', 'link', '|',
			'fontcolor', 'backcolor', '|', 'alignleft', 'aligncenter', 'alignright', 'justify', '|', 'horizontalrule', '|',
			'insertsource', 'insertsourcewithnums'],
		buttonsCustom : {
			insertsource : {
				title: 'Insert Source',
				callback: funcInsertSource
			},
			insertsourcewithnums : {
				title: 'Insert Source with Line number',
				callback: funcInsertSourceWithNums
			}
		}
	});
});
})(jQuery);